package gf.server.serviceImpl;

import gf.server.entities.File;
import gf.server.mapper.TransfersFilesMapper;
import gf.server.service.FileService;
import org.springframework.stereotype.Service;

/**
 * @author Gaofeng
 * @since 2021/10/17 15:54
 **/

@Service
public class FileServiceImpl implements FileService {

    //构造函数方式注入mapper
    private final TransfersFilesMapper transfersFilesMapper;

    public FileServiceImpl(TransfersFilesMapper transfersFilesMapper) {
        this.transfersFilesMapper = transfersFilesMapper;
    }


    @Override
    public int addFile(File file) {
        transfersFilesMapper.addFile(file);
        return 0;
    }

    @Override
    public File findUrl(String uuid) {
        return transfersFilesMapper.findUrl(uuid);
    }
}
